package ProducerConsumer_test1;

public class PublicResource {
	private int number = 0;
	
	//增加
	public synchronized void increace(){
		while (number!=0){
			try{
				wait();
			}catch (InterruptedException e){
				e.printStackTrace();
			}
			
			number++;
			System.out.println(number);
			notify();
		}
	}
}
